<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body{
        width: auto;
        height: 700px;
        display: flex;
        justify-content: center;
        align-items: center;
       }
    .container {
        width: 500px;
        background-color: hsl(0, 8%, 88%);
        display: flex;
        justify-content: center;
        align-content: flex-start;
        border-radius: 15px;
    }
    a{
        text-decoration: none;
        color: black;
        font-size: 12px;
        display: flex;
        justify-content: center;
        margin-bottom: 20px;
        user-select: none;
    }
    
    li{
        list-style: none;
        display: flex;
        flex-direction: column;
        flex-grow: 0.2;
    }

    img{
        align-self: center;
        margin-top: 20px;
        width: 40px;
        height: 40px;
        user-select: none;
    }

    .none{
        display: none;
    }
    .block{
        display: block;
    }
</style>

<body>
    <div class="container">
        <li>
            <img src="./首页off.png" alt="" class="block">
            <img src="./首页 on.png" alt="" class="none">
            <a href="https://www.mi.com/shop">首页</a>
        </li>
        <li>
            <img src="./分类off.png" alt="" class="block">
            <img src="./分类 on.png" alt="" class="none">
            <a href="https://www.mi.com/shop">分类</a>
        </li>
        <li>
            <img src="./我的off.png" alt="" class="block">
            <img src="./我的 on.png" alt="" class="none">
            <a href="https://www.mi.com/shop">我的</a>
        </li>
        <li>
            <img src="./星球off.png" alt="" class="block">
            <img src="./星球 on.png" alt="" class="none">
            <a href="https://www.mi.com/shop">米圈</a>
        </li>
        <li>
            <img src="./购物车空off.png" alt="" class="block">
            <img src="./购物车空 on.png" alt="" class="none">
            <a href="https://www.mi.com/shop">购物车</a>
        </li>
    </div>
    <script>

        var li = document.querySelectorAll('li');
        var none = document.querySelectorAll('.none');
        var block = document.querySelectorAll('.block');

        for(var i = 0;i<li.length;i++){
            li[i].addEventListener('click',function(){
                i = 0;
                for(var j = 0;j<li.length;j++){
                        block[i].style.display = 'block';
                        none[i].style.display = 'none';
                    i++;
                }
                this.children[0].style.display = 'none';
                this.children[1].style.display = 'block';
            })
        }
        
    </script>
</body>
</html>